﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Entity;

public partial class Pages_ContactUs : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["loginClient"] != null)
        { 
        
        }
        else
        {
            Response.Redirect("../Pages/Login.aspx");
        }
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        Customer cus = (Customer)Session["loginClient"];
        FeedBackUI feedui = new FeedBackUI();
        int result = feedui.Add(txtTitle.Text.Trim(), txtContent.Text.Trim(), DateTime.Now, false, cus.Cusid);
        if (result > 0)
        {
            Response.Write("<script>alert('Send feedback successful');</script>");
            txtContent.Text = "";
            txtTitle.Text = "";
        }
        else
        {
            Response.Write("<script>alert('Send feedback fail');</script>");
        }
    }
}
